<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
 	<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
	<title> Web rezervacije</title>
	<script type="text/javascript" src="js/submitButton.js"></script>
	<script type="text/javascript" src="js/checkTextField.js"></script>
	<script type="text/javascript" src="js/validateNumber.js"></script>
</head>

<f:view>
	<h1>Prijavljen korisnik: <h:outputText value="#{users.user.username}" /> </h1>
	<h2>Dodavanje leta</h2>
	
	<div style="visibility: hidden;" id="praznaPolja">
	<p><font color="red">Morate popuniti sva polja</font></p></div>

	<form method="post" action="AddFlightServlet" onsubmit="return submitButton();">
  		<table border="0" width="60%">
  		<tr><td><div id="idLetaP">ID leta:</div></td><td><input id="idLeta" type="text" name="idLeta" onblur="checkTextField(this);"/></td>   </tr>
  		<tr><td><div id="datumPolaskaP">Datum polaska:</div></td><td><input id="datumPolaska" type="datetime-local" name="datumPolaska" onblur="checkTextField(this);"/></td>  </tr>
  		<tr><td><div id="datumDolaskaP">Datum dolaska:</div></td><td><input id="datumDolaska" type="datetime-local" name="datumDolaska" onblur="checkTextField(this);"/></td>  </tr>
  		<tr><td><div id="polazniAerodromP">Polazni aerodrom:</div></td><td><input id="polazniAerodrom" type="text" name="polazniAerodrom" onblur="checkTextField(this);"/></td>  </tr>
  		<tr><td><div id="odredisniAerodromP">Odredisni aerodrom:</div></td><td><input id="odredisniAerodrom" type="text" name="odrediste" onblur="checkTextField(this);"/></td>  </tr>
  		<tr><td><div id="brojSedistaP">Broj sedista:</div></td><td><input  id="brojSedista" type="text" name="brojPutnika" onblur="checkTextField(this);" onkeypress="validateNumber(event)"/></td>  </tr>
  		<tr><td> &nbsp; </td><td><input type="submit" name="submit" value="Dodaj"/></td></tr>
  		</table>
  	</form>
  	
  	<p><a href="listFlightServlet?listFlight=flights">Spisak svih letova</a></p>

</f:view>

</html>